Optimal. Leaf size=40 \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}+\frac{\tanh ^{-1}(\sin (x))}{a+b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0509571, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {3190, 391, 206, 205} \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}+\frac{\tanh ^{-1}(\sin (x))}{a+b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3190
Rule 391
Rule 206
Rule 205
Rubi steps
\begin{align*} \int \frac{\sec (x)}{a+b \sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\sin (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )}{a+b}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\sin (x)\right )}{a+b}\\ &=\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}+\frac{\tanh ^{-1}(\sin (x))}{a+b}\\ \end{align*}
Mathematica [B] time = 0.124296, size = 96, normalized size = 2.4 \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a}}\right )-\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \csc (x)}{\sqrt{b}}\right )+2 \sqrt{a} \left (\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )\right )}{2 \sqrt{a} (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 55, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( -1+\sin \left ( x \right ) \right ) }{2\,a+2\,b}}+{\frac{\ln \left ( 1+\sin \left ( x \right ) \right ) }{2\,a+2\,b}}+{\frac{b}{a+b}\arctan \left ({\sin \left ( x \right ) b{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.28405, size = 308, normalized size = 7.7 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a}} \log \left (-\frac{b \cos \left (x\right )^{2} - 2 \, a \sqrt{-\frac{b}{a}} \sin \left (x\right ) + a - b}{b \cos \left (x\right )^{2} - a - b}\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}}, \frac{2 \, \sqrt{\frac{b}{a}} \arctan \left (\sqrt{\frac{b}{a}} \sin \left (x\right )\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{a + b \sin ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09957, size = 66, normalized size = 1.65 \begin{align*} \frac{b \arctan \left (\frac{b \sin \left (x\right )}{\sqrt{a b}}\right )}{\sqrt{a b}{\left (a + b\right )}} + \frac{\log \left (\sin \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} - \frac{\log \left (-\sin \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]